home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / DFQBX31.ZIP;1 / PBC-SUBS.DOC < prev    next >
Encoding:
Text File  |  1993-12-10  |  37.2 KB  |  1,156 lines

  1.  
  2.  The following routines are available for your use. DoorFrame itself does not
  3. use most of the routines so you may retain or delete them from DFRAMEX.LIB as
  4. you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
  5. library is modularized so if you don't CALL a routine in your code, it will
  6. not be included in the final .EXE file. Since these routines come from the
  7. PBClone library by Tom Hanlin, I have taken the liberty of including his
  8. descriptions of the routines.
  9.  
  10. Name  : BigPrint             (Called by DoorFrame - DON'T DELETE!)
  11. Class : Display
  12. Level : BIOS
  13.  
  14. As the name suggests, this routine displays text in large
  15. characters.  How large?  Eight times as high and as wide as
  16. normal!  Each "big character" will be composed of many
  17. normal-sized characters.  You may choose the normal character
  18. used to create the big characters (the default is a CHR$(219)
  19. solid block character, if you pass a null string here).
  20.  
  21. You should avoid using CHR$(128) to CHR$(255) when in either of
  22. the CGA graphics modes, as many CGAs are unable to display
  23. these characters when in graphics mode.
  24.  
  25.  
  26.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  27.  
  28. St$       string to display in big characters
  29. FormCh$   character used to compose the big characters
  30. Row%      starting row
  31. Column%   starting column
  32. Attr%     color/attribute of big characters (see CalcAttr)
  33.           NOTE: This is a local only procedure. It will NOT be sent to the
  34.                 remote computer!
  35.  
  36.  
  37. Name  : CalcAttr                (Called by DoorFrame - DON'T DELETE!)
  38. Class : Display
  39. Level : Any
  40.  
  41. An attribute is a combination of the foreground and background colors in a 
  42. format which is used by all types of displays when in text mode. 
  43.  
  44. Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
  45.  
  46.    CalcAttr Foreground%, Background%, Attr%
  47.  
  48. Foreground%  foreground color
  49. Background%  background color
  50. -------
  51. Attr%        color "attribute"
  52.  
  53.  
  54. Name  : CalcDate             (Calculate Date)
  55. Class : Time
  56. Level : Any
  57.  
  58. This routine calculates what the date will be a given number of
  59. days from now, either in the past or the future.  Actually, you
  60. may use any starting date, not just the current date.  An error
  61. code is returned if the starting date or resulting date are not
  62. valid.  Dates may not preceed January 1, 1900.
  63.  
  64. CalcDate accepts the date in any standard form ("01/30/91" or
  65. "01-30-1991", for example) and returns its results in the same
  66. format.
  67.  
  68.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  69.  
  70. StartDate$   starting date
  71. Days&        number of days from the current date (0 or more)
  72. Direction%   return future result (0) or past (nonzero)
  73. -------
  74. NewDate$     resulting date
  75. ErrCode%     whether the dates are valid (0 yes)
  76.  
  77.  
  78. Name  : CDROM
  79. Class : Disk / Equipment
  80. Level : DOS
  81.  
  82. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  83. If so, it tells you what the letter of the first CD-ROM logical drive is and
  84. how many logical drives exist.
  85.  
  86. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  87. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  88. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  89. similarly afflicted.
  90.  
  91.    FirstDrive$ = "x"
  92.    CDROM FirstDrive$, Drives%
  93.  
  94. -------
  95. FirstDrive$   letter of the first logical drive (init to at least one space!)
  96. Drives%       number of logical drives available (0 if no CD-ROM is there)
  97.  
  98.  
  99. Name  : CheckDate            (Check Date validity)
  100. Class : Time
  101. Level : Any
  102.  
  103. This routine checks a date to see if it is valid.
  104.  
  105.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  106.  
  107. MonthNr%     month number (1-12)
  108. DayNr%       day number (1-31)
  109. YearNr%      year number (1900 on; years <100 assumed 1900s)
  110. -------
  111. ErrCode%     whether the date is valid (0 yes)
  112.  
  113.  
  114. Name  : CheckShare           (Check for SHARE)
  115. Class : Disk
  116. Level : DOS
  117.  
  118. The CheckShare routine determines whether SHARE.EXE is active.
  119. This is particularly helpful before using the BASIC OPEN
  120. statement, which will fail if you request file sharing when
  121. it's not available.  The PBClone file routines handle such
  122. situations automatically, so CheckShare is not needed for them.
  123.  
  124.    CheckShare ShareActive%
  125.  
  126. -------
  127. ShareActive%   whether SHARE is active (0 if no)
  128.  
  129.  
  130. Name  : CheckShare2%         (Check for SHARE)
  131. Class : Disk
  132. Level : DOS
  133.  
  134. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  135. particularly helpful before using the BASIC OPEN statement, which will fail
  136. if you request file sharing when it's not available.  The PBClone file
  137. routines handle such situations automatically, so CheckShare2% is not needed
  138. for them.
  139.  
  140.    ShareActive% = CheckShare2%
  141.  
  142. -------
  143. ShareActive%   whether SHARE is active (0 if no)
  144.  
  145. Name  : Cipher               (Cipher)
  146. Class : String
  147. Level : Any
  148.  
  149. This is a very simple text encryption routine.  It isn't
  150. particularly hard to crack, but will provide a basic level of
  151. security for undemanding applications.  The same routine can be
  152. used either to encrypt or decrypt text.  The original text may
  153. contain any character; likewise, the resulting text.  This is
  154. not well suited for use with sequential files-- if such is
  155. required, see CipherP.
  156.  
  157. I'd suggest using a long password composed of an unlikely
  158. string of characters, e.g. "#*@@!A^%x{.'".
  159.  
  160.    Cipher St$, Password$
  161.  
  162. St$        string to encrypt or decrypt
  163. Password$  password
  164. -------
  165. St$        encrypted or decrypted string
  166.  
  167.  
  168. Name  : CipherP              (Cipher Printable)
  169. Class : String
  170. Level : Any
  171.  
  172. This is a very simple text encryption routine.  It isn't
  173. particularly hard to crack, but will provide a basic level of
  174. security for undemanding applications.  The same routine can be
  175. used either to encrypt or decrypt text.  The original text may
  176. contain any character below CHR$(128), as may the password.
  177. The resulting text will be printable, if bizarre (all
  178. characters will be above CHR$(127)), and may be used with
  179. sequential files.
  180.  
  181. This routine is potentially less secure than the Cipher routine
  182. (see).
  183.  
  184. I'd suggest using a long password composed of an unlikely
  185. string of characters, e.g. "#*@@!A^%x{.'".
  186.  
  187.    CipherP St$, Password$
  188.  
  189. St$        string to encrypt or decrypt
  190. Password$  password
  191. -------
  192. St$        encrypted or decrypted string
  193.  
  194. Name  : DateA2R              (Date Actual to Relative)
  195. Class : Time
  196. Level : Any
  197.  
  198. This routine converts an actual date to a relative date,
  199. expressed as a number of days.  This allows you to compare
  200. dates, find out what the date will be in a given number of days
  201. (or what it was a given number of days ago), see how many days
  202. passed between two dates, and so forth.
  203.  
  204. I've frequently seen routines of this nature called "Julian
  205. date" routines. I'm not sure where that nomenclature
  206. originated, as it has nothing to do with the Julian calendar.
  207. Most of these routines rely on approximations through floating
  208. point math, and may or may not handle leap years and centuries
  209. appropriately.  The DateA2R routine takes no such shortcuts and
  210. may be relied upon to return accurate results.
  211.  
  212.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  213.  
  214. MonthNr%     month number (1-12)
  215. DayNr%       day number (1-31)
  216. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  217. -------
  218. RelDate&     relative date
  219.  
  220.  
  221. Name  : DateN2S              (Date Numbers to String)
  222. Class : Time
  223. Level : Any / DOS
  224.  
  225. Many of the PBClone routines return the date as a set of
  226. numbers.  This routine provides an easy way to convert those
  227. numbers into string form.  The date format used (year length
  228. and delimiter) will be based on the string which you pass to
  229. the routine.  For instance, "xx-xx-xxxx" will return a date
  230. like "11-26-1990", whereas "xx.xx.xxxx" would return
  231. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  232.  
  233. If you pass zeroes for the MonthNr%, Day%, and Year% values,
  234. the current date will be returned in the format that you
  235. specified.
  236.  
  237. The ProBas and PBClone versions of this routine do not work the
  238. same way in regards to the year.  ProBas assumed that any
  239. two-digit year was in the 1900s.  In contrast, PBClone assumes
  240. that years 80-99 should be converted to 1980-1999 and that 0-79
  241. should be converted to 2000-2079.
  242.  
  243.    DateSt$ = "xx-xx-xxxx"
  244.    DateN2S MonthNr%, Day%, Year%, DateSt$
  245.  
  246. MonthNr%  month
  247. Day%      day
  248. Year%     year
  249. -------
  250. DateSt$   date string.  Init to 8 or 10 chars (see above).
  251.  
  252.  
  253. Name  : DateR2A              (Date Relative to Actual)
  254. Class : Time
  255. Level : Any
  256.  
  257. This is the opposite of the DateA2R routine-- it takes a
  258. "relative" date and converts it back to the usual form.
  259.  
  260.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  261.  
  262. RelDate&     relative date
  263. -------
  264. MonthNr%     month number (1-12)
  265. DayNr%       day number (1-31)
  266. YearNr%      year number (1900 on)
  267.  
  268.  
  269. Name  : DateS2N              (Date String to Numbers)
  270. Class : Time
  271. Level : Any
  272.  
  273. Many of the PBClone routines need to be passed the date as a
  274. set of numbers. This routine provides an easy way to convert a
  275. date from string form into numbers.  You may use either
  276. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  277. length is important, but the delimiter and contents of the
  278. string are ignored).
  279.  
  280. The ProBas and PBClone versions of this routine do not work the
  281. same way in regards to the year.  ProBas assumed that any
  282. two-digit year was in the 1900s.  In contrast, PBClone assumes
  283. that years 80-99 should be converted to 1980-1999 and that 0-79
  284. should be converted to 2000-2079.
  285.  
  286.    DateS2N MonthNr%, Day%, Year%, DateSt$
  287.  
  288. DateSt$   date string.  Init to 8 or 10 characters (see above).
  289. -------
  290. MonthNr%  month
  291. Day%      day
  292. Year%     year
  293.  
  294.  
  295. Name  : DelFile
  296. Class : Disk
  297. Level : DOS
  298.  
  299. This works like the DOS DEL (or ERASE) command, although it does not allow
  300. wildcards.  The specified file is deleted.  Full path specifications are
  301. supported, including drive and subdirectory specs.
  302.  
  303.    DelFile FileName$, ErrCode%
  304.  
  305. FileName$   name of the file to delete
  306. -------
  307. ErrCode%    0 if no error, else DOS Error
  308.  
  309.  
  310. Name  : DriveSpace&
  311. Class : Disk
  312. Level : DOS
  313.  
  314. This routine tells you how many bytes are free on a specified disk drive.
  315.  
  316.    BytesFree& = DriveSpace&(Drive$)
  317.  
  318. Drive$      letter of the drive to examine
  319. -------
  320. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  321.  
  322.  
  323. Name  : DrvType              (Drive Type)
  324. Class : Disk
  325. Level : DOS 3.1+
  326.  
  327. The DrvType routine tells you whether a specified drive is
  328. fixed or removeable, and whether it is local or remote (network
  329. drive).
  330.  
  331.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  332.  
  333. Drive$       letter of the drive to examine
  334. -------
  335. Removeable%  whether the disk can be removed (0 if no)
  336. Remote%      whether this is a remote drive (0 if no)
  337. ErrCode%     error code: 0 if none, else bad DOS version
  338.  
  339. Name  : Elapsed              (Elapsed time)
  340. Class : Time
  341. Level : Any
  342.  
  343. This routine tells you the amount of time elapsed between a
  344. given starting time and ending time.  The difference between
  345. the times must be less than 24 hours for the results to be
  346. meaningful.
  347.  
  348.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  349.  
  350. TimeStart$   starting time
  351. TimeStop$    ending time
  352. -------
  353. TimeDiff$    elapsed time
  354.  
  355. Name  : EMSBuffer
  356. Class : Memory
  357. Level : BIOS
  358.  
  359. EMSBuffer tells you how many bytes are needed to save the state of the EMS
  360. array routines.  Used in conjunction with EMSSave and EMSRest, it allows you
  361. to preserve EMS arrays across a CHAIN to another part of your program.
  362.  
  363.    EMSBuffer Bytes%
  364.    EMSState$ = SPACE$(Bytes%)
  365.    EMSSave EMSState$
  366.  
  367. -------
  368. Bytes%       bytes needed to save EMS array state
  369.  
  370. Name  : EMSClose
  371. Class : Memory
  372. Level : BIOS
  373.  
  374. The EMSClose routine is used when you are finished with an EMS array.  It
  375. frees the array handle and EMS memory for other uses.  If you don't close all
  376. EMS arrays before your program ends, the memory will be lost until the system
  377. is rebooted, so it is important to remember EMSClose.
  378.  
  379.    EMSClose ArrayHandle%
  380.  
  381. ArrayHandle%    handle of an EMS array
  382.  
  383.  
  384. Name  : EMSGet
  385. Class : Memory
  386. Level : BIOS
  387.  
  388. This routine gets an element from an EMS array created by EMSOpen.  Element
  389. numbers start at 0.  Be sure to use the right numeric type for the array--
  390. for instance, if you opened the array for SINGLE precision, use "Value!".
  391.  
  392.    EMSGet ArrayHandle%, ElementNr&, Value
  393.  
  394. ArrayHandle%    handle of an EMS array
  395. ElementNr&      element number to get
  396. -------
  397. Value           value to get element into (must be correct type for array)
  398.  
  399.  
  400. Name  : EMSOpen
  401. Class : Memory
  402. Level : BIOS
  403.  
  404. This routine allows you to open a block of EMS (expanded) memory which can
  405. then be accessed like a numeric array.  The array size is limited only by
  406. available EMS memory (use GetLIMM to find out how much is available).  You
  407. may specify any numeric type:
  408.  
  409.     1   INTEGER
  410.     2   LONG or SINGLE
  411.     3   DOUBLE
  412.  
  413. When the array is opened, you are returned an "array handle" which is used to
  414. access that array.  Access to the array is done via EMSGet and EMSPut.  When
  415. you are finished with the array, you must close it with EMSClose.
  416.  
  417. As many as 25 EMS arrays can be in use at one time, subject to limitations
  418. which may be imposed by your EMS driver (each array requires one EMS handle).
  419.  
  420.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  421.  
  422. Elements&       number of elements in array (like DIM size)
  423. ElementType%    numeric type of array (see above)
  424. -------
  425. ArrayHandle%    handle of an EMS array
  426. ErrCode%        whether an error occurred (0 no)
  427.  
  428.  
  429. Name  : EMSPut
  430. Class : Memory
  431. Level : BIOS
  432.  
  433. This routine puts an element into an EMS array created by EMSOpen.  Element
  434. numbers start at 0.  Be sure to use the right numeric type for the array--
  435. for instance, if you opened the array for SINGLE precision, use "Value!".
  436.  
  437.    EMSPut ArrayHandle%, ElementNr&, Value
  438.  
  439. ArrayHandle%    handle of an EMS array
  440. ElementNr&      element number to set
  441. Value           value to set element to (must be correct type for array)
  442.  
  443.  
  444. Name  : EMSRest
  445. Class : Memory
  446. Level : BIOS
  447.  
  448. This routine allows you to restore the state of the EMS array handler.  Used
  449. in conjunction with EMSBuffer and EMSSave, it allows you to preserve EMS
  450. arrays across a CHAIN to another part of your program.
  451.  
  452.    EMSRest EMSState$
  453.  
  454. EMSState$    saved EMS array state
  455.  
  456.  
  457. Name  : EMSSave
  458. Class : Memory
  459. Level : BIOS
  460.  
  461. This routine allows you to save the state of the EMS array handler.  Used in
  462. conjunction with EMSBuffer and EMSRest, it allows you to preserve EMS arrays
  463. across a CHAIN to another part of your program.
  464.  
  465.    EMSBuffer Bytes%
  466.    EMSState$ = SPACE$(Bytes%)
  467.    EMSSave EMSState$
  468.  
  469. -------
  470. EMSState$    saved EMS array state
  471.  
  472.  
  473. Name  : EnhKbd
  474. Class : Input
  475. Level : BIOS
  476.  
  477. By default, the PBClone routines assume an old-style keyboard is in use, for
  478. greatest compatibility.  EnhKbd allows you to turn on enhanced keyboard
  479. handling for the current generation of (usually) 101-key keyboards.  This
  480. allows access to the F11 and F12 function keys as well as codes for key
  481. combinations that used to be ignored, among other things.
  482.  
  483. The KbdType or KbdType2% routine can be used to determine if an enhanced
  484. keyboard is available (recommended).
  485.  
  486. Note that EnhKbd works by intercepting the BIOS keyboard handler.  All calls
  487. to the BIOS keyboard interrupt are converted from the old keyboard functions
  488. to the new ones.  YOU MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can
  489. restore the old setup.  Otherwise, the computer will most probably crash.
  490.  
  491.    EnhKbd Enable%
  492.  
  493. Enable%     turn on enhanced keyboard support (0 disable, else enable)
  494.  
  495.  
  496. Name  : EuropeDate           (European Date format)
  497. Class : Time
  498. Level : Any
  499.  
  500. This routine takes a date in one of the American formats
  501. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  502. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  503. according to a format string which provides the desired
  504. delimiter and year length, e.g. "##-##-##" specifies a
  505. delimiter of "-" and a year length of two digits.
  506.  
  507. An error code is returned if the date is not valid.
  508.  
  509.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  510.  
  511. DateSt$     date to format (month, day, year order)
  512. Format$     format for the date
  513. -------
  514. Result$     resulting date (day, month, year order)
  515. ErrCode     whether the date is valid (0 ok)
  516.  
  517.  
  518. Name  : FormatDate           (Format Date)
  519. Class : Time
  520. Level : Any
  521.  
  522. This is a highly flexible date formatting routine.  It accepts
  523. a date in one of the usual American formats ("03-22-1990",
  524. "03/22/90", or even "3/22/90") and converts it according to a
  525. format string.  This format string allows you to normalize the
  526. date, select a new delimiter, choose between two-digit and
  527. four-digit years, and even change the order from month/day/year
  528. to anything else.  An error code will be returned if the date
  529. is not valid.
  530.  
  531. The format string can be as simple as "##/##/##", which
  532. specifies that the usual month/day/year order be used, with a
  533. delimiter of "/" and a two-digit year.  If you want to change
  534. the date order, you would need a format like "DD.MM.YYYY"
  535. instead.  For sorting or storage, you might want to convert the
  536. date to a plain number, using a format string like "YYYYMMDD".
  537. The result could then be converted to a LONG with the BASIC VAL
  538. function.
  539.  
  540.    FormatDate DateSt$, Format$, Result$, ErrCode%
  541.  
  542. DateSt$     date to format (month, day, year order)
  543. Format$     format for the date
  544. -------
  545. Result$     resulting date
  546. ErrCode     whether the date is valid (0 ok)
  547.  
  548.  
  549. Name  : Get4DOSv             (Get 4DOS Version)
  550. Class : Equipment
  551. Level : DOS
  552. The Get4DOSv routine returns the version of 4DOS being used.  It returns the
  553. results as two integers containing the major and minor version numbers. For
  554. instance, 4DOS 4.0 would return a major number of 4, minor 0.  If 4DOS is not
  555. installed, both version numbers will be zero.
  556. If you're not familiar with 4DOS, it's a terrific improved replacement for
  557. COMMAND.COM.  For more information, write JP Software Inc., P.O. Box 1470,
  558. Arlington MA 02174, or call your local BBS.
  559.  
  560.    Get4DOSv MajorV%, MinorV%
  561.  
  562. -------
  563. MajorV%   major part of the 4DOS version
  564. MinorV%   minor part of the 4DOS version
  565.  
  566. Name  : GetDOSV                 (Called by DoorFrame - DON'T DELETE!)
  567. Class : Equipment
  568. Level : DOS
  569. The GetDOSV routine tells you what version of DOS you're using.  It returns
  570. the results as two integers containing the major and minor version numbers.
  571. For instance, MS-DOS 2.11 would return a major number of 2, minor 11.
  572.  
  573. The OS/2 compatibility box returns version numbers beginning at 10.00.  For
  574. instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0 returns 20.00.
  575.  
  576.    GetDOSV MajorV%, MinorV%
  577.  
  578. -------
  579. MajorV%   major part of the DOS version
  580. MinorV%   minor part of the DOS version
  581.  
  582. Name  : Getdrv               (Get default Drive)
  583. Class : Disk
  584. Level : DOS
  585.  
  586. This routine tells you the letter of the current default drive.
  587.    Drive$ = "x"
  588.    GetDrv Drive$
  589.  
  590. -------
  591. Drive$    default drive letter.  Init to at least one character.
  592.  
  593. Name  : GetDView
  594. Class : Miscellaneous
  595. Level : DOS
  596.  
  597. The GetDView routine tells you what version of DESQview is loaded.  It
  598. returns the results as two integers containing the major and minor version
  599. numbers.  For instance, DESQview 2.0 would return a major number of 2 and a
  600. minor number of 0.  If DESQview is not loaded, zeroes are returned.
  601. See also GetTView, GetTVScreen, UpdTVScreen.
  602.  
  603.    GetDView MajorV%, MinorV%
  604.  
  605. -------
  606. MajorV%   major part of the DESQview version (0 if DESQview is not loaded)
  607. MinorV%   minor part of the DESQview version
  608.  
  609.  
  610. Name  : GetexecPath          (Get Execution Path of program)
  611. Class : Disk
  612. Level : DOS 3.0+
  613.  
  614. This routine returns the full path of your program, i.e., the
  615. drive, subdirectory, and name of the program.  It does not rely
  616. on the current drive and subdirectory settings or look at the
  617. PATH setting-- DOS tells it directly.  This makes it an
  618. excellent way to find the program's "home" directory, where
  619. (hopefully) any data files associated with the program will
  620. also be stored.
  621.  
  622.    SelfName$ = SPACE$(80)
  623.    GetExecPath SelfName$, SelfLen%
  624.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  625.  
  626. -------
  627. SelfName$   full path for current program.  Init to 80+ chars.
  628. SelfLen%    length of the full path spec.
  629.  
  630.  
  631. Name  : GetKbd
  632. Class : Input
  633. Level : Clone
  634.  
  635. The GetKbd routine allows you to get the state of the four keyboard toggles:
  636. Insert, Caps lock, Num lock, and Scroll Lock.
  637.  
  638.    GetKbd Insert%, Caps%, Num%, Scrl%
  639.  
  640. -------
  641. Insert%    whether "insert" mode is on (0 if no)
  642. Caps%      whether "caps lock" is on (0 if no)
  643. Num%       whether "num lock" is on (0 if no)
  644. Scrl%      whether "scroll lock" is on (0 if no)
  645.  
  646.  
  647. Name  : GetKbd1
  648. Class : Input
  649. Level : Clone
  650.  
  651. The GetKbd1 routine allows you to get the state of the four keyboard shift
  652. keys: Left shift, Right shift, Control and Alt.
  653.  
  654.    GetKbd1 LShift%, RShift%, Control%, Alt%
  655.  
  656. -------
  657. LShift%    whether the left shift key is depressed (0 if no)
  658. RShift%    whether the right shift key is depressed (0 if no)
  659. Control%   whether a control key is depressed (0 if no)
  660. Alt%       whether an alt key is depressed (0 if no)
  661.  
  662.  
  663. Name  : GetKbd2
  664. Class : Input
  665. Level : AT BIOS
  666.  
  667. The GetKbd2 routine allows you to get the state of the six keyboard shift
  668. keys on an "enhanced" keyboard: Left shift, Right shift, Left Control, Right
  669. Control, Left Alt and Right Alt.
  670.  
  671. Normally, the BIOS only lets you see one key at a time, which can be a
  672. barrier when you need more input.  This is a particular problem with action
  673. games and other real-time applications which have complex input requirements.
  674. Due to the special way the BIOS treats shift keys, GetKbd2 can tell if the
  675. the various shift keys are pressed simultaneously, allowing more flexibility.
  676.  
  677.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  678.  
  679. -------
  680. LShift%    whether the left shift key is depressed (0 if no)
  681. RShift%    whether the right shift key is depressed (0 if no)
  682. LCtrl%     whether the left control key is depressed (0 if no)
  683. RCtrl%     whether the right control key is depressed (0 if no)
  684. LAlt%      whether the left alt key is depressed (0 if no)
  685. RAlt%      whether the right alt key is depressed (0 if no)
  686.  
  687. Name  : GetLIMHandles
  688. Class : Memory
  689. Level : DOS
  690.  
  691. Early Lotus/Intel/Microsoft expanded memory revisions provided a limited
  692. number of "handles" which could be used to access expanded memory-- often as
  693. few as 15 or so.  If your program uses expanded memory and the EMS driver is
  694. one of the older versions, you may want to make sure that enough handles are
  695. available.  This routine tells you how many handles are in use.
  696.  
  697. Note that this routine expects an EMS driver to be installed.  If you can't
  698. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  699.  
  700.    GetLIMHandles Handles%
  701.  
  702. -------
  703. Handles%  number of EMS handles in use
  704.  
  705. Name  : GetLIMM
  706. Class : Memory / Equipment
  707. Level : DOS
  708.  
  709. This routine tells you how much expanded memory is installed.  If there is
  710. none, or if the EMS driver hasn't been installed, it returns zeroes.  You
  711. should use this routine before any other of the PBClone routines that access
  712. expanded memory, since the other routines expect EMS to be available.
  713.  
  714. The results are returned in terms of EMS pages.  Each page is 16 kilobytes.
  715.  
  716.    GetLIMM TotalPages%, FreePages%
  717.  
  718. -------
  719. TotalPages%  number of EMS pages installed
  720. FreePages%   number of EMS pages available for use
  721.  
  722.  
  723. Name  : GetLIMV
  724. Class : Memory / Equipment
  725. Level : DOS
  726.  
  727. The GetLIMV routine tells you the version of EMS driver that is being used.
  728. The version number is separated into major and minor parts.  For example, an
  729. EMS 3.1 driver would return a major number of 3 and minor number of 1.
  730.  
  731. Note that this routine expects an EMS driver to be installed.  If you can't
  732. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  733.  
  734.    GetLIMV MajorVer%, MinorVer%
  735.  
  736. -------
  737. MajorVer%  major part of the EMS version number
  738. MinorVer%  minor part of the EMS version number
  739.  
  740. Name  : GetTView             (Get TopView)
  741. Class : Miscellaneous
  742. Level : BIOS
  743.  
  744. This routine tells you whether TopView or a compatible multitasker (such as
  745. TaskView or DESQview) is loaded.
  746. See also GetDView, GetTVScreen, UpdTVScreen.
  747.  
  748.    GetTView Installed%
  749.  
  750. -------
  751. Installed%   whether a TopView-type multitasker is loaded (0 no)
  752.  
  753. Name  : GetTVScreen          (Get TopView Screen address)
  754. Class : Display / Miscellaneous
  755. Level : BIOS
  756.  
  757. GetTVScreen returns the address of the screen buffer used by a TopView-type
  758. multitasker.  This allows you to use direct screen access while remaining
  759. within the windows allocated to your program by the multitasker.
  760.  
  761. You must tell the multitasker the address of the screen you would be writing
  762. to if the multitasker was not installed.  Specify a segment of &HB000 if
  763. using an MDA or Hercules, or a segment of &HB800 for CGA, EGA, MCGA or VGA.
  764. The offset should always be 0.  This is for use in text modes.
  765.  
  766. The routine will return with the new segment and offset for you to use.
  767. These values can be used with any PBClone screen routine that accepts a
  768. segment and offset-- DQPrint and DXQPrint, for example.
  769.  
  770. Note that not all TopView-compatible multitaskers will automatically update
  771. the screen from the buffer.  The UpdTVScreen routine allows you to force a
  772. screen update.
  773. See also GetDView, GetTView, UpdTVScreen.
  774.  
  775.    GetTVScreen DSeg%, DOfs%
  776.  
  777. DSeg%       segment of desired screen
  778. DOfs%       offset of desired screen
  779. -------
  780. DSeg%       segment of screen buffer
  781. DOfs%       offset of screen buffer
  782.  
  783.  
  784. Name  : KbdType
  785. Class : Input / Equipment
  786. Level : Clone
  787.  
  788. This routine tells you if an enhanced (101-key) keyboard is available.
  789.  
  790. KbdType differs from the ProBas routine of the same name in that it has
  791. additional error checking.  If it is not entirely sure that an enhanced
  792. keyboard is available, it plays safe and assumes there isn't one.  This
  793. avoids possible disaster on older PCs.
  794.  
  795.    KbdType Enhanced%
  796.  
  797. -------
  798. Enhanced%    whether keyboard is of the enhanced type (0 no)
  799.  
  800.  
  801. Name  : LClose
  802. Class : Memory
  803. Level : BIOS
  804.  
  805. This routine closes a block of expanded memory that was opened for access by
  806. LOpen.  It is important to close the block when you are finished with it, to
  807. return it to the free memory pool.
  808.  
  809. Routines in this suite include: LOpen, LGet, LPut, LClose.
  810.  
  811.    LClose EMSHandle%
  812.  
  813. EMSHandle%    handle of the expanded memory block
  814.  
  815.  
  816. Name  : LGet
  817. Class : Memory
  818. Level : BIOS
  819.  
  820. This routine gets a block of data from expanded memory that was opened for
  821. access by LOpen.  The amount of data is specified in words; one word is the
  822. same as two bytes.  An integer takes up a word, long integers and single
  823. precision numbers require two words, and double precision numbers take four.
  824.  
  825. Routines in this suite include: LOpen, LGet, LPut, LClose.
  826.  
  827.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  828.  
  829. EMSHandle%    handle of the expanded memory block
  830. DSeg%         segment of place to store data
  831. DOfs%         offset of place to store data
  832. Words%        words to get from expanded memory
  833.  
  834.  
  835. Name  : LOpen
  836. Class : Memory
  837. Level : BIOS
  838.  
  839. This routine opens a block of expanded memory for access.  The size of the
  840. block is specified in words; one word is the same as two bytes.  An integer
  841. takes up a word, long integers and single precision numbers require two
  842. words, and double precision numbers take four.  This allows you to store up
  843. to 64K in each EMS block that you open.
  844.  
  845. Note that LOpen expects an EMS driver to be available.  If you are not
  846. certain on this point, use GetLIMM beforehand to make sure.
  847.  
  848. Routines in this suite include: LOpen, LGet, LPut, LClose.
  849.  
  850.    LOpen Words%, EMSHandle%, ErrCode%
  851.  
  852. Words%        size of expanded memory block to allocate
  853. -------
  854. EMSHandle%    handle of the expanded memory block
  855. ErrCode%      error code (0 if no error)
  856.  
  857. Name  : LPut
  858. Class : Memory
  859. Level : BIOS
  860.  
  861. This routine puts a block of data into expanded memory that was opened for
  862. access by LOpen.  The amount of data is specified in words; one word is the
  863. same as two bytes.  An integer takes up a word, long integers and single
  864. precision numbers require two words, and double precision numbers take four.
  865.  
  866. Routines in this suite include: LOpen, LGet, LPut, LClose.
  867.  
  868.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  869.  
  870. EMSHandle%    handle of the expanded memory block
  871. DSeg%         segment of place from which to get data
  872. DOfs%         offset of place from which to get data
  873. Words%        words to put into expanded memory
  874.  
  875. Name  : LRotate
  876. Class : String
  877. Level : Any
  878.  
  879. Many years ago, I wrote one of the first terminal programs for the PC.  It
  880. died a horrible death when Qmodem came out... sigh.  This routine comes from
  881. that experience.  It rotates the characters in a string left once (e.g.,
  882. "ABCDE" becomes "BCDEA").  I used this in my routine to dial a list of BBSes,
  883. skipping to the next one if the current one was busy.
  884.  
  885. LRotate can also be handy for things like scrolling a long message across the
  886. screen (you just PRINT LEFT$(Message$, 80); then delay a bit, LRotate and do
  887. it again).
  888.  
  889.    LRotate St$
  890.  
  891. St$     string to be rotated left once
  892. -------
  893. St$     string after being rotated left once
  894.  
  895.  
  896. Name  : NameCase                (Called by DoorFrame - DON'T DELETE!)
  897. Class : String
  898. Level : Any
  899.  
  900. This routine provides a specialized uppercase/lowercase converter designed
  901. especially for names.  It converts the first letter in each word in a string
  902. to uppercase, with the rest of the word being converted to lowercase.
  903.  
  904. See also NameCase2, the FUNCTION version of this routine.
  905.  
  906.    NameCase St$
  907.  
  908. St$         string to process
  909. -------
  910. St$         processed string
  911.  
  912.  
  913. Name  : NameCase2$           (Name Case)
  914. Class : String
  915. Level : Any
  916.  
  917. This routine provides a specialized uppercase/lowercase
  918. converter designed especially for names.  It converts the first
  919. letter in each word in a string to uppercase, with the rest of
  920. the word being converted to lowercase.
  921.  
  922. See also NameCase, the SUB version of this routine.
  923.  
  924.    Result$ = NameCase2$(St$)
  925.  
  926. St$         string to process
  927. -------
  928. Result$     processed string
  929.  
  930.  
  931. Name  : Processor
  932. Class : Equipment
  933. Level : Any
  934.  
  935. Processor returns the type of processor (CPU) installed.
  936.  
  937. Results are returned as follows:
  938.  
  939.    0    NEC V20
  940.    1    8088 or 8086
  941.    2    80186
  942.    3    80286
  943.    4    80386 or 80486
  944.  
  945.    Processor ProcType%
  946.  
  947. -------
  948. ProcType%    type of CPU (see above)
  949.  
  950.  
  951. Name  : Retries
  952. Class : Disk
  953. Level : DOS 3.1+
  954. This routine allows you to adjust the handling of file-sharing errors.  When
  955. such an error occurs, DOS normally retries 3 times, with a wait of 1 between
  956. tries.  This allows temporary conditions, such as someone else using the file
  957. you want to access, to clear up.  In many cases, though, you may want to
  958. change this delay.  A shorter delay will improve response time, allowing your
  959. program to handle the error more quickly.  A longer delay may be more suited
  960. for a busy network, allowing the request to proceed after a reasonable
  961. waiting period.
  962.  
  963. The delay period between each retry is unfortunately machine-dependent, i.e.,
  964. you will need larger delays on faster machines to achieve the same effect.
  965. This can only be considered a flaw in DOS.
  966.  
  967. Note that shorter waiting periods will improve response time for your
  968. program, but may adversely affect the network.  Normally, you should use the
  969. longest waiting period with which you feel comfortable.
  970.  
  971.    Retries Times%, WaitTime%
  972.  
  973. Times%     number of times to retry if a file-sharing violation occurs
  974. WaitTime%  amount of time to delay between retries
  975.  
  976. Name  : Reverse              (Reverse)
  977. Class : String
  978. Level : Any
  979. This little fellow reverses the order of the characters in a
  980. string.  It is one of the vital components of RInstr, but other
  981. than that I see no real use for it.  On the other hand, George
  982. Boole thought that Boolean logic was of solely theoretical
  983. interest, and yet without it there would be no computers. I
  984. leave it to you to find the earth-shattering possibilities of
  985. Reverse!
  986.  
  987.    Reverse St$
  988.  
  989. St$      string to be reversed
  990. -------
  991. St$      reversed string
  992.  
  993. Name  : RInstr               (Reverse INSTR)
  994. Class : String
  995. Level : Any
  996. Like INSTR, this routine tells you the position of a substring
  997. within a string.  A "reverse" search is used, however-- whereas
  998. INSTR tells you the first match, RInstr tells you the last
  999. match.  Similarly, whereas INSTR will tell you that a null
  1000. search string matches the main string at the first position,
  1001. RInstr will match on the last position.  Of course, most of the
  1002. time you won't be searching for a null string!
  1003.  
  1004.    RInstr MainSt$, SeekSt$, Posn%
  1005.  
  1006. MainSt$    string to search
  1007. SeekSt$    string for which to search
  1008. -------
  1009. Posn%      position of substring within main string (0 no match)
  1010.  
  1011.  
  1012. Name  : Sec2Time$            (Seconds to Time)
  1013. Class : Time
  1014. Level : Any
  1015.  
  1016. This routine converts the number of seconds past midnight into
  1017. a time string.
  1018.  
  1019.    TimeSt$ = Sec2Time$(Seconds&)
  1020.  
  1021. Seconds&   number of seconds past midnight
  1022. -------
  1023. TimeSt$    time string (TIME$ format)
  1024.  
  1025. Name  : SetError
  1026. Class : Miscellaneous
  1027. Level : DOS
  1028. The SetError routine allows you to set the "error level" to be returned by
  1029. DOS when your program ends.  This is particularly handy for returning
  1030. information to batch files.
  1031. Note that SetError is best used just before your program ENDs, to avoid
  1032. complications.
  1033.  
  1034.    SetError ErrorLevel%
  1035.  
  1036. ErrorLevel%   exit code to be returned by your program
  1037.  
  1038. Name  : SetKbd
  1039. Class : Input
  1040. Level : Clone
  1041. The SetKbd routine allows you to set the state of any of the four keyboard
  1042. toggles: Insert, Caps lock, Num lock, and Scroll Lock.  You can give your
  1043. input routines a professional touch by setting this toggles instead of making
  1044. the user remember to do so.
  1045.  
  1046. It's considered proper to restore the original keyboard toggles before your
  1047. program exits, unless of course the purpose of the program is to leave the
  1048. toggles in a particular state!  The GetKbd routine can be used in conjunction
  1049. with SetKbd to do this.
  1050.  
  1051.    SetKbd Insert%, Caps%, Num%, Scrl%
  1052.  
  1053. Insert%    whether to turn on "insert" mode (0 if no)
  1054. Caps%      whether to turn on "caps lock" (0 if no)
  1055. Num%       whether to put the keypad into numeric mode (0 if no)
  1056. Scrl%      whether to turn on "scroll lock" (0 if no)
  1057.  
  1058. Name  : Time2Sec&            (Time to Seconds)
  1059. Class : Time
  1060. Level : Any
  1061. This routine converts a time string into the number of seconds
  1062. past midnight. This is convenient if you want to find the
  1063. difference between two times or to calculate what time it will
  1064. be after a given interval.
  1065.  
  1066.    Seconds& = Time2Sec&(TimeSt$)
  1067.  
  1068. TimeSt$    time string (TIME$ format)
  1069. -------
  1070. Seconds&   number of seconds past midnight
  1071.  
  1072.  
  1073. Name  : TInstr               (Typed INSTR)
  1074. Class : String
  1075. Level : Any
  1076. As you might guess from the "Instr" part of the name, this
  1077. routine searches a string.  Instead of searching for a specific
  1078. character or substring, though, it looks for a specific type of
  1079. character-- letters, numbers, control codes, or whatever.  You
  1080. can search for the first of a combination of types, too, which
  1081. also allows searching for "anything but" a specific type.
  1082.  
  1083. The character type code is specified by adding any of the
  1084. following:
  1085.  
  1086.     1    alphabetic
  1087.     2    numeric
  1088.     4    symbolic
  1089.     8    control
  1090.    16    graphics
  1091.    32    space
  1092. The TInstr routine is handy for parsing and cleaning up user
  1093. input, among other uses.
  1094.  
  1095.    TInstr St$, ChrType%, Place%
  1096.  
  1097. St$          string to search
  1098. ChrType%     type of character(s) to search for
  1099. -------
  1100. Place%       position of first char of desired type, or 0
  1101.  
  1102. Name  : UnCalcAttr           (Undo Calculated Attribute)
  1103. Class : Display
  1104. Level : Any
  1105.  
  1106. Many of the display routines in this library require an
  1107. "attribute" rather than foreground and background colors.  An
  1108. attribute is a combination of the foreground and background
  1109. colors in a format which is used by all types of displays when
  1110. in text mode.  The UnCalcAttr routine allows you to decode the
  1111. original colors given the attribute.
  1112.  
  1113. Foreground colors are usually specified as 0-31, with
  1114. backgrounds as 0-7.
  1115.  
  1116.    UnCalcAttr Foreground%, Background%, Attr%
  1117.  
  1118. Attr%         color "attribute"
  1119. -------
  1120. Foreground%   foreground color
  1121. Background%   background color
  1122.  
  1123.  
  1124. Name  : UpdTVScreen          (Update TopView Screen)
  1125. Class : Display
  1126. Level : BIOS
  1127. UpdTVScreen tells a TopView-compatible multitasker to update the screen using
  1128. a specified screen buffer (use GetTVScreen to get the buffer location).  Some
  1129. multitaskers will do this automatically, but some won't.  It's safe to use
  1130. this routine either way.
  1131.  
  1132. See also GetDView, GetTView, GetTVScreen.
  1133.  
  1134.    UpdTVScreen DSeg%, DOfs%
  1135.  
  1136. DSeg%       segment of screen buffer
  1137. DOfs%       offset of screen buffer
  1138.  
  1139. Name  : WinCheck             (Windows Check)
  1140. Class : Equipment
  1141. Level : BIOS
  1142. The WinCheck routine tells you what version of Microsoft Windows is in use,
  1143. if any.  It returns the results as two integers containing the major and
  1144. minor version numbers.  For instance, Windows 3.0 would return a major number
  1145. of 3, minor 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  1146. not running, 0.0 will be returned.  NOTE that this routine is not able to
  1147. detect Windows 1.x versions!
  1148.  
  1149.    WinCheck MajorV%, MinorV%
  1150.  
  1151. -------
  1152. MajorV%   major part of the Windows version
  1153. MinorV%   minor part of the Windows version
  1154.  
  1155.  
  1156.